package com.arcvideo.acsplayer.httprequest;

import org.json.JSONObject;

import com.arcvideo.acsplayer.config.ApplicationConfig;

public class VideoRequest extends ArcHttpRequest {

	public VideoRequest() {
		// http://api.hongshiyun.net/rest?accessKey=ac92adda-02b&sort=title&order=asc&start=1&action=queryVideo&number=20&signature=d8d1f07b526d7ff8312e2b182f5b368c6584fb7ab3e1cfa7eb9fdb1729246a8a
		super("rest");
	}

	@Override
	protected Object doInBackground(Object... params) {
		String action = (String) params[0];
		String start = (String) params[1];
		String number = (String) params[2];
		String sort = (String) params[3];
		String order = (String) params[4];
		String signature = (String) params[5];

		appendGetParameter("accessKey", ApplicationConfig.ACCESSKEY);
		appendGetParameter("action", action);
		appendGetParameter("start", start);
		appendGetParameter("number", number);
		appendGetParameter("sort", sort);
		appendGetParameter("order", order);
		appendGetParameter("signature", signature);

		JSONObject object = requestGetDataJsonObject();
		if (object != null) {
			return object;
		}
		return null;
	}
}
